home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / batch / library / batutl2 / reboot.asm < prev    next >
Assembly Source File  |  1988-04-20  |  2KB  |  60 lines

  1.     PAGE    ,132
  2.     TITLE    REBOOT -- Command to Force a Reboot
  3.     %OUT    History
  4.  
  5. ; reboot.asm  20 Mar 85  Craig Milo Rogers at USC/ISI
  6. ;    Copied from Info-IBMPC Digest V4 #34, made format changes,
  7. ; and fixed bugs.  The original was by Joeseph M. Newcomer,
  8. ; based on REBOOT.SEQ in the Info-IBMPC library.
  9.  
  10. ;    This program reboots your IBM-PC, but omits the memory
  11. ; diagnostic.  WARNING!  There is code here which is very
  12. ; BIOS dependent!
  13.  
  14. ;    The following commands should remake this program:
  15. ;        MASM REBOOT;
  16. ;        LINK REBOOT;
  17. ;        EXE2BIN REBOOT
  18. ;        RENAME REBOOT.BIN REBOOT.COM
  19. ;        DEL REBOOT.EXE
  20.  
  21.     %OUT    BIOS RAM Locations
  22.  
  23. BIOSCOM    SEGMENT AT 40H
  24.     ORG    BIOSCOM+72H
  25. RESET_FLAG DW    ?        ; Warm/cold restart flag.
  26. BIOSCOM    ENDS
  27.  
  28.     %OUT    Start of Program and Data
  29.  
  30. ;    The following location (RESTART) holds the address of the
  31. ; label START in the IBMPC ROM BIOS.  Jumping to START does a cold
  32. ; boot, but skips the RAM check step.  Warning!  The address of START
  33. ; may be different in IBM-PC clones, or even in later releases of IBM
  34. ; BIOS.  [Toad Hall Note:  Still works with PCDOS 3.1]
  35.  
  36.     CODESEG SEGMENT 'CODE'        ; Start the code segment
  37.     ASSUME    CS:CODESEG,DS:CODESEG
  38.  
  39.     ORG    100H        ; Beginning of code area.
  40.  
  41. BEGIN:    JMP    SHORT CLRBFI    ; Jump around data area.
  42.  
  43. RESTART  LABEL    DWORD
  44.     DW    0E05BH        ; IP for reboot
  45.     DW    0F000H        ; CS for reboot
  46.  
  47.     %OUT    Code
  48.  
  49. CLRBFI:
  50.     MOV    AX,SEG BIOSCOM    ; Point to BIOS data segment.
  51.     MOV    DS,AX
  52.     ASSUME    DS:BIOSCOM
  53.  
  54.     MOV    RESET_FLAG,1234H ; Set 'Warm Start' flag.
  55.     JMP    RESTART        ; Jump into BIOS.
  56.  
  57. CODESEG    ENDS
  58.  
  59.     END BEGIN
  60.